package com.allwees.bs.module.pms.vo;

import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.allwees.bs.core.model.util.PhotosStr;
import com.allwees.core.common.constant.EStatus;
import com.allwees.core.common.util.EnumUtil;
import com.allwees.core.wf.Action;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * 产品审核日志
 *
 * @author yangylsky
 * @since 2019-12-25
 */
@Data
public class ProductAuditLogVo implements PhotosStr, Serializable {

    private static final long serialVersionUID = 8265814793869796803L;

    private String productUuid;

    private Date createdAt;

    private String reason;

    private String remark;

    private String photosStr;

    @JsonIgnore
    @JSONField(serialize = false)
    private Integer afterActionStatus;

    @JsonIgnore
    @JSONField(serialize = false)
    private String actionClassName;

    @JsonIgnore
    @JSONField(serialize = false)
    private String wfAction;

    public String getActionDesc() {
        return ((Action) EnumUtil.getEnum(actionClassName, wfAction)).desc();
    }

    public String getStatusDesc() {
        return EStatus.byValue(afterActionStatus).desc();
    }
}
